
/*
*Pool Public Licence version 0.1 or later
*Released on 20th April 2008.
*Any voilations can be repoted at paritosh@wikiocean.net
*What is treated as voilations can be found at www.wikiocean.net/ppl1-voilations* 
******************************************************************************
* The contents of this file are subject Affero GPL v3 and later with additional conditions.
* The additional conditions are to be considered as part of the Affero GPL v3 and later.
* The additional conditions will supersede the Affero GPLv3 and later in case of conflict.
* ("License"); You may not use this file except in compliance with the License
* You may obtain a copy of the License at http://www.gnu.org/licenses/agpl.html
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Initial Developer of the Original Code is Paritosh Pungaliya.
* created by Paritosh Pungaliya are Copyright (C) Paritosh Pungaliya; All Rights Reserved.
* Contributions are Copyright (C) 2001-2008 Paritosh Pungaliya.

* Objective of the additional terms (license) 
* 1) Is to extend the software freedom to freedom to work.
* 2) To ensure that knowledge is free from monopoly of agencie(s).
* 3) To avoid a situation where big corporates or investors can buy out free software groups and companies and then start milking the communities built around it.
* (this trend can be seen how the openness changes in companies that get Venture Capital funding.)
* (if you agree to this logic I invite you to our group to work together)

* Additional conditions
*  0) Source code will also include
* 	a) data dictionaries, data ontologies which are used to alter the behavior of code or to control           the features of application.
* 	b) Any code generated or derived automatically or manually from this code or logic
*  1) The revenue generated by deploying, implementing , selling services and other activities
*  	 based on this source code should be shared 100%, between the people working on it.
*  2) Capital invested should be given only fixed rate of return or linked to revenue/surplus growth for limited time.
*  3) People working on the project should always have an option to replace the capital provider in full or part with lower cost capital.
*  4) Their should not be any ownership which can be sold as a claim on future profit to be generated from the work of people working on the code.
*  5) Brand thus generated should belong to the group.
*  6) For old and new members revenue sharing should be equal for same work equivalent.
*  7) The share of revenue should be decided by bidding for work before allocation of work within the group.
*  8) Before bidding various method of measuring the work should be clearly defined and published in public domain. Any change in process should also be publised in public domain imediately.
*  9) All data related to to revenue sharing should be published as and when generated in public domain.
*  10) For group of people having size more than 10 people will have to make it open online for others to participate in bids. 
*  11) All people involved in related and sub project will be treated as a group.
*  12) Once this license is being used for a certain code then all and any other software services being provided by the group should complusorilly come under 100% revenue sharing.
*  13) Cross subsidization should not happen under this revenue share, no additional benefit should be drawn from the people, by the employing agency.
*  14) Any position or knowledge or legal structure created relating to people working on code, which adversely affects the spirit of 100% revenue share will be treated as a violation.
*  15) Revenue sharing defined.
*     a) includes direct revenue and also intangible gains like brand, and organization.
*     b) No personal judgment should be involved in judging the distribution of revenue.It has to be pre-defined formula based.
*     c)100% of revenue should be shared before expenses and recievers should have control over what expenses to incur.
*     d)For the work done in any month by contributing group member, working on any project can be given revenue share from the work done by the group, for a maximum of 18 months after that month.
*     e)Revenue should be apportioned to the month in which work is done and not when received.
*  The group fulfilling the above conditions also has to be a wiki ecosystem further defined in www.wekosystem.org or read about Wekosystem at www.wikiocean.net

*  ******************************************************************************
*/  
package pool.tablename;


import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import timer.ExecutionTimer;
import timer.TimerRecordFile;
import utility.ConvertToLower;

import utility.MessageGenerator;

import dbmanager.ChekInMaster;
import dbmanager.DBManager;
import dbmanager.GetIdName;

/**
 * 
 * @author Administrator TD_property_details class do the insertion for the
 *         properties of item presents in given message and Updation,Deletion
 *         and view operation for the properties of each item which is present
 *         in Transaction_details. id stores id of td_property_details table.
 *         Tdid stores id of transaction_details table for which item property
 *         has to be entered. Pid stores id of property from master table. Pv
 *         stores id of value of property from master table. Vt stores text
 *         value for property if id of 'pv' is not present in Master_table. ref
 *         stores reference to particular transaction item.
 * 
 */

public class Td_property_details extends SubPool
{
	
	public Hashtable<Object, Object> PropertyMap = new Hashtable<Object, Object>();

	private String tdpl_tableName = "td_property_details";	

	private String tdid = "no$";
	
	public Vector<Object> TdPropertyList = new Vector<Object>();	
	
	private Vector<Object> OldTdPropertyList = new Vector<Object>();
	private Vector<Object> NewTdPropertyList = new Vector<Object>();
	
	private Hashtable<Object,Object> ViewHashtable = new Hashtable<Object, Object>();
	
	public boolean boolTdpdSetCommit = true;
	
	//private int count;	
	//private ResultSet rs;
	//BasicReports basicReport;
	//private String td_tableName = "transaction_details";
	//private String TdPropertySPchar = "";
	
	
	public Td_property_details(){}
	
	
	public Td_property_details(DBManager sqldb, String msg, String process,String Request) 
	{
		ExecutionTimer t = new ExecutionTimer();
		 t.start();
		this.Request = Request;
		this.process = process;
		this.sqlDB = sqldb;
		message = msg;		
		gin = new GetIdName(sqldb);
		t.end();
		@SuppressWarnings("unused")
		TimerRecordFile timerFile=new TimerRecordFile("pool.tablename","Td_property_details","Td_property_details",t.duration());
	}
	
	
	public Td_property_details(DBManager sqldb)
	{	
		ExecutionTimer t = new ExecutionTimer();
		t.start();
		this.sqlDB = sqldb;
		gin = new GetIdName(sqldb);
		t.end();
		@SuppressWarnings("unused")
		TimerRecordFile timerFile=new TimerRecordFile("pool.tablename","Td_property_details","Td_property_details",t.duration());
	}
	

	@Override
	/**
	 * In getInsert of Td_property_details inserts the properties of items.
	 */
	public StringBuffer getInsert() 
	{
		ExecutionTimer t = new ExecutionTimer();
		t.start();
		
		
		Vector<Object> tempVector = new Vector<Object>();
		
		/*boolean flagReport=false;
		Vector<Object> tplVector = new Vector<Object>();		
		StringBuffer sbrDTB = new StringBuffer();
		ReplacesSpecialCharacter replace = new ReplacesSpecialCharacter(sqlDB);*/
		
		tempVector.addAll(TdPropertyList);
		ChekInMaster check = new ChekInMaster(sqlDB);
		if (PropertyMap.containsKey("ErrorInput")) 
		{
			flagResult = false;
			return new StringBuffer(PropertyMap.toString());			
		}
		try 
		{
			for (int i = 0; i < TdPropertyList.size(); i++)
			{
				Hashtable<Object, Object> tempProperty1 = new Hashtable<Object, Object>();
				Td_property_details tdpl = (Td_property_details) TdPropertyList.get(i);
				PropertyMap = gin.getRef(tdpl.PropertyMap);
				tempProperty1.putAll(tdpl.PropertyMap);
				tempProperty1.put("tdid", tdid);
				
				if (check.isInProperty_details(tempProperty1, tdpl_tableName) == false)
				{
					int j = sqlDB.getInsert(tdpl_tableName, tempProperty1);
					if (j > 0) 
					{
						//tplVector.add(tempProperty1); // It will create the
														// vector for the
														// Reports class.
						//flagReport = true;
												
						System.out.println("\nretail::Td_property_Details ::getInsert():: Inserted Property in "+ tdpl_tableName + " .........\n\n");
						sqlDB.pLog.Logger.append("\n " + Request+ " Added Success fully........ ");
						
						sbrDTB.append(" Following Td_property_Details is Added..."+tempProperty1.toString());
						
						strID = tdid;
						flagResult = true;						
					} 
					else 
					{
						sbrDTB.append(" pool::Td_property_Details ::getInsert():: Unable to insert into Property Details ");
						System.out.println("pool::Td_property_Details ::getInsert():: Unable to insert into Property Details\n\n");
						sqlDB.pLog.Logger.append("\n Unable to insert into Trans_Property Details........ \n\n");
						flagResult = false;
					}
					
					if(flagResult == true)
						continue;
					else
						break;
				} 
				else
				{
					sbrDTB.append(" pool::Td_property_Details ::getInsert():: Property Already exist ");
					System.out.println("pool::Td_property_Details ::getInsert():: Property Already exist ");
					sqlDB.pLog.Logger.append("\n Property Already exist ");
					flagResult = false;
				}
			}
			/*if(flagReport == true)
			{
				setVector(oldVector, tplVector);
				Request = tdpl_tableName;
				getReport();
			}*/
			
		} 
		catch (Exception e) {
			e.printStackTrace();
			System.out.println("pool::TDPropertyDetail::getInsert():: Exception In Insert Method of PropertyDetails");
		}
		
		boolTdpdSetCommit = flagResult;
		//sbrDTB.append(" Inserted in TDPD ");
		t.end();
		@SuppressWarnings("unused")
		TimerRecordFile timerFile=new TimerRecordFile("pool.tablename","Td_property_details","getInsert",t.duration());
		
		return sbrDTB;
	}
	
	
	@SuppressWarnings("unchecked")
	public StringBuffer getUpdate()
	{
		ExecutionTimer t = new ExecutionTimer();
		t.start();	
	
		ChekInMaster check = new ChekInMaster(sqlDB);
		/*boolean flagReport = false;
        Vector<Object> pdbsNewVector = new Vector<Object>();
   		Vector<Object> pdbsOldVector = new Vector<Object>();*/
   		
		
		for(int i = 0; i < NewTdPropertyList.size();i++ )
		{
			Hashtable<Object,Object> newTransactionMap = new Hashtable<Object,Object>(); /** It will get stores new mesage for Update.*/
			Hashtable<Object,Object> oldTransactionMap = new Hashtable<Object, Object>(); /** It will get stores old mesage for Update.*/
			
			try
			{
				oldTransactionMap = (Hashtable<Object, Object>)OldTdPropertyList.get(i);
				newTransactionMap = (Hashtable<Object, Object>)NewTdPropertyList.get(i);
			}
			catch (Exception e)
			{
				newTransactionMap = (Hashtable<Object, Object>)NewTdPropertyList.get(i);
				oldTransactionMap.put("tdid", newTransactionMap.get("tdid"));
				oldTransactionMap.put("pid", newTransactionMap.get("pid"));
			}
			try 
			{
			  	Hashtable<Object, Object> temp = new Hashtable<Object, Object>();
			  	Hashtable<Object, Object> temp1 = new Hashtable<Object, Object>();
	      		try 
				{
	      			temp = sqlDB.getSelectCheck(oldTransactionMap,tdpl_tableName);
					if (temp.containsKey("Error")) 
					{
						flagResult = false;
						return new StringBuffer(oldTransactionMap.toString());
					}
					temp = ConvertToLower.convertHashKey(temp);
				} catch (Exception e) {
				}
			  	temp1.putAll(temp);
			  	temp1.putAll(oldTransactionMap);
				oldTransactionMap = temp1; 
					
	        	temp.putAll(newTransactionMap);
	        	newTransactionMap.clear();
	        	newTransactionMap.putAll(temp);
	        }
			catch (Exception e){}
			
				if (check.isInProperty_details(oldTransactionMap,tdpl_tableName) == false)
				{
					sbrDTB.append(" Old Property Not Present ");
					System.out.println("Old Property Not Present ");
					sqlDB.pLog.Logger.append("\n Old Property Not Present ");
					flagResult = false;
					return sbrDTB;				
				}
				if (check.isInProperty_details(newTransactionMap,tdpl_tableName) == true)
				{
					sbrDTB.append(" New and Old Property are same ");
					System.out.println(" New and Old Property are same ");
					sqlDB.pLog.Logger.append("\n New and Old Property are same ");
					flagResult = false;
					return sbrDTB;
				}
				
				if (check.isInProperty_details(newTransactionMap, tdpl_tableName) == false && check.isInProperty_details(oldTransactionMap,tdpl_tableName) == true)
				{
					int j=sqlDB.getUpdate(tdpl_tableName, newTransactionMap,oldTransactionMap);
					if(j>0)
		       		{
																	
		       			sqlDB.pLog.Logger.append("\n "+ Request +" updated Success fully........ ");						
						sbrDTB.append(" updated Success fully........ ");
						
						strID = oldTransactionMap.get("tdid").toString();
						flagResult = true;						
		       		}
					else
					{
						System.out.println("pool::Td_property_details::getUpdate():: Unable to Update........");
						sbrDTB.append(" Unable to Update ");
						flagResult = false;
					}
					
					if(flagResult == true)
						continue;
					else
						break;
					/*newTransactionMap.remove("id");
					oldTransactionMap.remove("id");
					pdbsOldVector.add(oldTransactionMap); // It will create the vector for the Old property.
	    			pdbsNewVector.add(newTransactionMap); // It will create the vector for the New property.
	    			flagReport = true;*/
				}
				else
				{
					System.out.println("pool::Td_property_details::getUpdate():: Unable to Update. old property is not present ");
					sbrDTB.append("Unable to Update. old property is not present .");
					flagResult = false;
				}
		
			/*if(flagReport == true)
			{
				setVector(pdbsNewVector, pdbsOldVector);
				Request = tdpl_tableName;
				getReport();
				PropertyDetailsBasicReports pdbs = new PropertyDetailsBasicReports(pdbsOldVector,sqlDB,process);
				pdbs.updateReport(pdbsNewVector);
			}*/
				
		}
		t.end();
		@SuppressWarnings("unused")
		TimerRecordFile timerFile=new TimerRecordFile("pool.tablename","Td_property_details","directUpdate",t.duration());
		return sbrDTB;
	
	}
	
	
	@SuppressWarnings("unchecked")
	@Override
	public StringBuffer getView()
	{

		ExecutionTimer t = new ExecutionTimer();
		t.start();
		StringBuffer sbrProperty=new StringBuffer();
		MessageGenerator msg=new MessageGenerator(sqlDB);
		
		Vector<Object> vtdpl  = new Vector<Object>(); 
		Hashtable<Object, Object> Hashtdpl=new Hashtable<Object, Object>();		
		
		if(tdid.equals("no$"))
		{
			Hashtdpl.putAll(ViewHashtable);
			if(Hashtdpl.containsKey("tdid"))
				tdid = Hashtdpl.get("tdid").toString();
		}
		
		if(!tdid.equals("no$"))
			Hashtdpl.put("tdid", tdid);
		
		Enumeration< Object> enum1 = Hashtdpl.keys();
		if(enum1.hasMoreElements()==false)
		{
				sbrProperty.append("Record not available.Check tid,item and quantity");
				return sbrProperty;
		}		
		
		//According to the Hashtdpl(contains tdid) getSelectVector method checks the condition ,searches all the record 
		//in td_property_details table  and stores into the vrs vector.
		
		vtdpl.addAll(sqlDB.getSelectVector(Hashtdpl, tdpl_tableName));
		
		if(vtdpl.isEmpty())
		{
			sbrProperty.append("Record not available");
			return sbrProperty;
		}
		StringBuffer Heading =new StringBuffer();		
		String Tdplproperties="";
		String lastMid="";
		for(int j=0;j<vtdpl.size();j++)
		{
			String Tdplproperty="";
			String Tdpl="";
			Hashtable<Object, Object> TdplObj=new Hashtable<Object, Object>();
			TdplObj=(Hashtable<Object, Object>) vtdpl.get(j);
			TdplObj.putAll(ConvertToLower.convertHashKey(TdplObj));
			
			//TdplObj contain whole record (e.tdid,pid,pv,vt,ref) which has taken through the database 
			//(td_property_details table) according to the condition value. 
			
			Hashtable<Object, Object> HashTdpl=new Hashtable<Object, Object>();
			HashTdpl.put("tdid", TdplObj.get("tdid"));
			//dpl=msg.convertToMessage(tdpl_tableName, process, HashTdpl);			
			
			//TdplObj.putAll(gin.CheckFromMaster(TdplObj, process));
			TdplObj.remove("tdid");			
			
			
			try {
				Heading.append(gin.getItem(TdplObj.get("pid").toString())+"\t");
				String value = "0";
				if(TdplObj.containsKey("pv"))
				  value=gin.getItem(TdplObj.get("pv").toString());
				if(value.equals("0"))
					value = TdplObj.get("vt").toString();
				sbrProperty.append(value+"\t");
			} catch (Exception e) {
				e.printStackTrace();
			}
			//Tdplproperty is a generated message according to the TdplObj. 
			//Tdplproperty=msg.convertToMessage(tdpl_tableName, process, TdplObj);
			
			/*if(lastMid.equals(Tdpl))
			{
				Tdplproperties=Tdplproperties+Tdplproperty;
			}
			else
			{
				Tdplproperties=Tdplproperties+Tdpl+Tdplproperty;
			}
			
			lastMid=Tdpl;*/			
		}
		
		
		t.end();
		@SuppressWarnings("unused")
		TimerRecordFile timerFile=new TimerRecordFile("pool.tablename","Td_property_details","getView",t.duration());
		return Heading.append("\n"+sbrProperty);
	
	}

	
	
	public Hashtable<Object, Object> getBasicHashtable() 
	{
		return null;
	}
	
	public String getType() {	
		return null;
	}
	
	public void setHashtable(Hashtable<Object, Object> table) {		
		
	}	

	@Override
	public StringBuffer getDelete() {
		
		return null;
	}

	public void setProcess(String tempProcess) 
	{
		ExecutionTimer t = new ExecutionTimer();
		 t.start();
		process = tempProcess;
		t.end();
		@SuppressWarnings("unused")
		TimerRecordFile timerFile=new TimerRecordFile("pool.tablename","Master_table","setProcess",t.duration());
	}
	
	public void setPropertyVector(Vector<Object> propertydetails) 
	{
		this.TdPropertyList=propertydetails;		
	}
	
	
	public void setTdid(String tdid) {
		ExecutionTimer t = new ExecutionTimer();
		t.start();
		this.tdid = tdid;
		t.end();
		@SuppressWarnings("unused")
		TimerRecordFile timerFile=new TimerRecordFile("pool.tablename","Property_details","setTdid",t.duration());
	
	}
	
	public void setNewPropertyVector(Vector<Object> NewPropertyVector)
	{
		ExecutionTimer t = new ExecutionTimer();
		 t.start();
		this.NewTdPropertyList = NewPropertyVector;	
		t.end();
		@SuppressWarnings("unused")
		TimerRecordFile timerFile=new TimerRecordFile("pool.tablename","Property_details","setNewPropertyVector",t.duration());
	}
	
	public void setOldPropertyVector(Vector<Object> OldPropertyVector)
	{
		ExecutionTimer t = new ExecutionTimer();
		 t.start();
		this.OldTdPropertyList = OldPropertyVector;	
		t.end();
		@SuppressWarnings("unused")
		TimerRecordFile timerFile=new TimerRecordFile("pool.tablename","Property_details","setOldPropertyVector",t.duration());
	}

	public void setViewHashtable(Hashtable<Object,Object> hashtable) {
		ViewHashtable.putAll(hashtable);
	}
	
	/**
	 * In getUpdate of Td_property_details pid,pv,ref of an item can be updated.
	 */
	/*public StringBuffer getUpdate()
	{
		ExecutionTimer t = new ExecutionTimer();
		t.start();
		ResultSet rs = null;
		String propertyChar = null;
		Command cp = new Command(Request, sqlDB);
		
		
		*//** It will get stores old message for Update. *//*
		ChekInMaster check = new ChekInMaster(sqlDB);
		String msg = " ";
		
		boolean flagReport = false;
        Vector<Object> pdbsNewVector = new Vector<Object>();
   		Vector<Object> pdbsOldVector = new Vector<Object>();
   		

		try 
		{
			rs = sqlDB.getSelect("select fieldname,spchar,order1 from command where msgtype='"+ tdpl_tableName+ "' and from_master='yes' and process='add' and order1>0 order by order1");
			rs.next();
			propertyChar = rs.getString("spchar");
			rs.close();
		}
		catch (Exception e) 
		{
			System.out.println("Property Char is not Found in Database");
		}
		int index = 0;
		count = cp.getCountof(message, tdpl_tableName, process);// getCount();
		if (count != 0) 
		{
			try 
			{
				rs = sqlDB.getSelect("select fieldname,spchar,order1 from command where msgtype='"+ tdpl_tableName+ "' and from_master='yes' and process='mod' and order1>0 order by order1");
				rs.next();
				TdPropertySPchar = rs.getString("spchar");
				rs.close();
				index = Index.indexOf(message, TdPropertySPchar, index + 1);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		
		String TDmsg="";
		TDmsg = message.substring(0,index);

		Hashtable<Object,Object> TdMap = new Hashtable<Object,Object>();
		TdMap.putAll(cp.getHashCommand(td_tableName,TDmsg, "add"));
		if(TdMap.containsKey("ErrorInput"))
		{
				return new StringBuffer(TdMap.toString());
		}
		TdMap = gin.convertMasterId(TdMap,td_tableName, "add");
		TdMap = GetIdName.removeno$(TdMap);
		String id = "";
		//GET TDID BY USING GIVEN CONDITION FOR TRANSACTION DETAILS
		try 
		{
			ResultSet rs1 = sqlDB.getselect(TdMap,td_tableName);		
			rs1.next();
			id = rs1.getString("id");
			tdid = id;
		} catch (Exception e) 
		{
			return new StringBuffer("Please Check the Transaction ID and Item");
		}
		TdMap = null;
		
		while (count != 0) 
		{
			Hashtable<Object, Object> newTransactionMap = new Hashtable<Object, Object>();
			*//** It will get stores new mesage for Update. *//*
			Hashtable<Object, Object> oldTransactionMap = new Hashtable<Object, Object>();
			*//** It will get stores old mesage for Update. *//*
			
			if (index == -1) 
			{
				break;
			}
			count--;
			try
			{
				int start = 0;
				int end = 0;
				start = index;
				msg = message.substring(start + 1);
				if (msg.contains(TdPropertySPchar))
				{
					end = Index.indexOf(msg, TdPropertySPchar) + start;
					msg = message.substring(start, end + 1);
				}
				else 
				{
					msg = message.substring(start);
					msg = msg.substring(0,message.length());			
				}
				index = end + 1;
			}
			catch (Exception e) 
			{
				e.printStackTrace();
			}
			boolean TYPEFLAG = false;
			String msg1 = "";
			String msg2 = "";
			int start = 0;
			if (msg.contains(propertyChar)) 
			{
				int end1 = 0;
				end1 = Index.indexOf(msg, propertyChar, end1 + 1);
				if (end1 == -1)
				{
					newTransactionMap.put("ErrorInput", "Item should insert");
				}
				msg1 = msg.substring(start, end1);
				TYPEFLAG = true;
			}
			else
			{
				msg1 = msg;
			}
			////////
			newTransactionMap.putAll(cp.getHashCommand(tdpl_tableName,msg1, process));
			if (newTransactionMap.containsKey("ErrorInput")) 
			{
				return new StringBuffer(newTransactionMap.toString());
			}
			
			newTransactionMap = ConvertToLower.convertHashKey(newTransactionMap);
	
			newTransactionMap = gin.ConvertPVtoVT(newTransactionMap);
			newTransactionMap = gin.convertMasterId(newTransactionMap,tdpl_tableName, "add");
			PropertyMap = cp.checkError(newTransactionMap, tdpl_tableName); 
			if (PropertyMap.containsKey("ErrorInput")) 
			{
				return new StringBuffer(PropertyMap.toString());
			}
			if (TYPEFLAG) 
			{
				start = Index.indexOf(msg, propertyChar, start + 1);
				msg2 = msg.substring(start, msg.length());
				oldTransactionMap.putAll(cp.getHashCommand(tdpl_tableName,msg2, "add"));
				if (oldTransactionMap.containsKey("ErrorInput")) 
				{
					return new StringBuffer(oldTransactionMap.toString());
				}
				
				oldTransactionMap = ConvertToLower.convertHashKey(oldTransactionMap);
				oldTransactionMap = gin.ConvertPVtoVT(oldTransactionMap);
				oldTransactionMap = gin.convertMasterId(oldTransactionMap,tdpl_tableName, process);
				PropertyMap = cp.checkError(oldTransactionMap,tdpl_tableName);
				if (PropertyMap.containsKey("ErrorInput")) 
				{
					return new StringBuffer(PropertyMap.toString());
				}
			} 
			else
			{
				oldTransactionMap.put("pid", newTransactionMap.get("pid"));
			}
			//SET TDID
			newTransactionMap.put("tdid", tdid);
			oldTransactionMap.put("tdid", tdid);
		
			try 
			{
			  	Hashtable<Object, Object> temp = new Hashtable<Object, Object>();
			  	Hashtable<Object, Object> temp1 = new Hashtable<Object, Object>();
          		try 
				{
          			temp = sqlDB.getSelectCheck(oldTransactionMap,tdpl_tableName);
					if (temp.containsKey("Error")) 
					{
						return new StringBuffer(oldTransactionMap.toString());
					}
					temp = ConvertToLower.convertHashKey(temp);
				} catch (Exception e) {
				}
			  	temp1.putAll(temp);
			  	temp1.putAll(oldTransactionMap);
				oldTransactionMap = temp1; 
					
            	temp.putAll(newTransactionMap);
            	newTransactionMap.clear();
            	newTransactionMap.putAll(temp);
            }
			catch (Exception e)
			{
			}
		
			if (check.isInProperty_details(oldTransactionMap,tdpl_tableName) == false)
			{
				sbrDTB.append(" Old Property Not Present ");
				System.out.println("Old Property Not Present ");
				sqlDB.pLog.Logger.append("\n Old Property Not Present ");
				return sbrDTB;
				
				
			}
			if (check.isInProperty_details(newTransactionMap,tdpl_tableName) == true)
			{
				sbrDTB.append(" New and Old Property are same ");
				System.out.println(" New and Old Property are same ");
				sqlDB.pLog.Logger.append("\n New and Old Property are same ");
				return sbrDTB;
			}
			
			if (check.isInProperty_details(newTransactionMap, tdpl_tableName) == false && check.isInProperty_details(oldTransactionMap,tdpl_tableName) == true)
			{
				int j=sqlDB.getUpdate(Request, newTransactionMap,oldTransactionMap);
				if(j>0)
	       		{
	       			sqlDB.pLog.Logger.append("\n "+ Request +" updated Success fully........ ");						
					sbrDTB.append(" updated Success fully........ ");
					
	       		}
				newTransactionMap.remove("id");
				oldTransactionMap.remove("id");
				pdbsOldVector.add(oldTransactionMap); // It will create the vector for the Old property.
    			pdbsNewVector.add(newTransactionMap); // It will create the vector for the New property.
    			flagReport = true;
			}
		}
		if(flagReport == true)
		{
			setVector(pdbsNewVector, pdbsOldVector);
			Request = tdpl_tableName;
			getReport();
			PropertyDetailsBasicReports pdbs = new PropertyDetailsBasicReports(pdbsOldVector,sqlDB,process);
			pdbs.updateReport(pdbsNewVector);
		}
		t.end();
		@SuppressWarnings("unused")
		TimerRecordFile timerFile=new TimerRecordFile("pool.tablename","Td_property_details","getUpdate",t.duration());
		return sbrDTB;
	}
*/
	
	/*
	public String getProceess() 
	{
		// TODO Auto-generated method stub
		return null;
	}*/
	/*public String getTable() 
	{
		return Request;
	}*/

	/*public void setTransactionMap(Hashtable<Object, Object> transactionMap2)
	{
		this.TransMap.putAll(transactionMap2);
		
	}*/
	/*public Vector<Object> getpropertyVector() {
	// TODO Auto-generated method stub
	return null;
	}*/
	/*public void setCount(int count) {
	ExecutionTimer t = new ExecutionTimer();
	t.start();
	this.count = count;
	t.end();
	@SuppressWarnings("unused")
	TimerRecordFile timerFile=new TimerRecordFile("pool.tablename","Property_details","setCount",t.duration());

	}*/

	public Hashtable<Object, Object> getDetailHashtabel() 
	{
		// TODO Auto-generated method stub
		return null;
	}

	public Hashtable<Object, Object> getHashtabel() 
	{
		// TODO Auto-generated method stub
		return null;
	}

	public String getTable() 
	{
		return Request;
	}
	
	 public Vector<Object> getpropertyVector(){
		 return null;
	 }
}
